package com.ha8.netease.models.vo
{

	public class ViewModel
	{
		public function ViewModel(user:UserModel = null, type:String = null)
		{
			this.user = user;
			this.type = type;
		}
		
		//--------------------------------------------------------------------------
		//
		//  Constants
		//
		//--------------------------------------------------------------------------
		
		public static const FANS:String = 'fans';
		public static const FRIENDS:String = 'friends';
		public static const MAIN:String = 'main';
		public static const FAVORITE:String = 'favorite';
		public static const MENTION:String = 'mention';
		
		//--------------------------------------------------------------------------
		//
		//  Variables
		//
		//--------------------------------------------------------------------------
		
		private var _user:UserModel;

		public function get user():UserModel
		{
			return _user;
		}

		public function set user(value:UserModel):void
		{
			_user = value;
		}

		
		private var _type:String;

		/**
		 * user list type 
		 */
		public function get type():String
		{
			return _type;
		}

		/**
		 * @private
		 */
		public function set type(value:String):void
		{
			_type = value;
		}

		
		//--------------------------------------------------------------------------
		//
		//  Methods
		//
		//--------------------------------------------------------------------------
		
		public function equal(value:ViewModel):Boolean
		{
			if (user.id == value.user.id && type == value.type)
				return true;
			else
				return false;
		}
		
	}
}